<?php

require_once 'Zend/View/Helper/Abstract.php';

class Core_View_Helper_Content_ListMostPopular extends Zend_View_Helper_Abstract
{
    /**
     * render a module page like news_showNewPosts
     */
    public function listMostPopular()
    {
        $popular = $this->view->pageObj->getPopularStories();
        if ($popular) {
            foreach ($popular as $story) {
                $link = Core_Toolbox_String::addHyphens($this->view->realPath($story->id));
                $data[] = '<a href="' . $link . '">' . $this->view->pageObj->getLabel($story) . '</a>';
            }
            if (is_array($data)) {
                return $this->view->htmlList($data);
            }
        }
    }
}